package com.qianfeng.smartdevice.mapper;

import com.qianfeng.smartdevice.pojo.Devices;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface DeviceMapper {
    @Select("SELECT * FROM devices")
    List<Devices> findAllDevices();

    @Update("UPDATE devices SET status=#{status} WHERE devicesuuid=#{devicesuuid}")
    int updateStatusByUUID(@Param("devicesuuid") String devicesuuid, @Param("status") String status);

    @Select("SELECT categoryid FROM devices WHERE devicesuuid =#{devicesuuid}")
    Long getCategoryIdByUUID(String uuid);
}
